<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">
    <head>
        <title></title>
        <meta charset="utf-8">
        <meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
        <link rel="stylesheet" href="css/fonts/font-awesome.min.css">
        <link rel="stylesheet" href="css/ui-box.css">
        <link rel="stylesheet" href="css/ui-base.css">
        <link rel="stylesheet" href="css/ui-color.css">
        <link rel="stylesheet" href="css/appcan.icon.css">
        <link rel="stylesheet" href="css/appcan.control.css">
        <link rel="stylesheet" href="css/base.css">
        <link rel="stylesheet" href="css/media.css"/>
        <link rel="stylesheet" href="css/lczjstyle.css?v=1238"/>
        <style type="text/css">
        #search{
            display: none;
        }
        .btn-img{
          background-image:url('images/zy_jk.png');
          background-position: center;
          background-repeat: no-repeat;
          background-size: 70%;
            
        }
         .c8EC2DA{
            background: #8EC2DA;
        }
        .hide{
            overflow: hidden; /*自动隐藏文字*/
            text-overflow: ellipsis;/*文字隐藏后添加省略号*/
            white-space: nowrap;/*强制不换行*/
        }                
        
         </style>
    </head>
    <body class="bcwhite">
    <div class="up ub ub-ver " tabindex="0" data-control="PAGE" id="Page">
        <!-- 搜索框开始 -->
        <div class=" wtp100 h_100" id="search" style="background-color: rgba(230,230,230,.8);position: fixed; z-index: 9999;">
            <div class="bdr-t"></div>
            <div id="wrap" class="ub-ver ub-ac bcwhite  wtp95 uc-a3 marat0">
                  <div class="pt10 wgt">
                    <div class="ub ub-pc fs9">
                        <div class="pr12 lh20">机场三字码</div>
                        <h6 class="bl bdr-black bora03 fs9 bl tx-c wtp40 lh20" id="SanZiMa" onclick="setSanZiMa()"></h6>
                    </div>
                </div>
                <div class="pt10 wtp80 marat0">
                    <div class="ub ub-pc fs9">
                        <div class="wtp45 bdr-black bora03 bc-img-r h20 lh20 tx-c pr10" id="startDate">请选择日期</div>
                        <div class="lh20 pl1 pr1">至</div>
                        <div class="wtp45 bdr-black bora03 bc-img-r endD lh20 tx-c pr10" id="endDate">请选择日期</div>
                    </div>
                </div>
                 
                <div class="pt5 pb5">
                    <div class="ub ub-pc fs9 tx-c cwhite">
                        <div class="w50 lh25 h25 bc6FCAE9 bora02" id="query">查询</div>
                    </div>
                </div>
            </div>
        </div>
        <!-- 搜索框结束 -->
        <!-- 内容开始 -->
        <div class="content wtp100" data-control="FLEXBOXVER" id="content">
            <div id="" class="ub cwhite">
                <div class="bc8EC2DA w35 h30 lh30 tx-c bdr-bw bs-lf">
                    <div class="fs11">归属地</div>
                </div>
                <div class="w30 h30 lh30 tx-c bcwhite c4892AA bdr-b3EC5F7">
                    <h6 class="fs10">机场</h6>
                </div>
                <div class="ub-f1">
                    <div class="ub-ver ub-pj h30 tx-c pt2 c4892AA bcwhite bdr-b3EC5F7">
                        <h6 class="fs9 ub-f1 tx-c wtp90">经<span id="IISZM">***</span>旅客中转办理统计<span>(I-I)</span></h6>
                        <div class="ub-f1 pt2 tx-c">
                            <div class="ub">
                                <h6 class="fs9 wtp36">办理总人数</h6>
                                <h6 class="fs9 wtp36">应办总人数</h6>
                                <h6 class="fs9 tx-l wtp28">百分比</h6>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- list item-->
            <div class="ub-ver ht100 wtp100">
                <ul id="list_ul">
                   
                </ul>
            </div>
        </div>
    </div>
    
    <script src="js/appcan.js"></script>
    <script src="js/appcan.control.js"></script>
    <script src="js/commo.js"></script>
    <script src="js/selectDate.js?v=123"></script>
    </body>
    <script>
    var LCZJhttp = appcan.locStorage.getVal('LCZJhttp');
        appcan.ready(function() {
            uexWindow.subscribeChannelNotification('inland', 'onNotification');
            uexWindow.onNotification = function(cb){
                eval(cb);
           };
        });
    var show = true;
    function seacrh(index){
       
      if(index==1){
      if(show){
       $('#search').css('display','block');   
       show = false;   
      }else{
        $('#search').css('display','none'); 
        show = true;    
      } 
     }
  
    }
           
  
  //查询方法
  $("#query").click(function(){
      
      //隐藏搜索框
      $('#search').css('display','none');      
      show = true;
      uexWindow.toast(1,5,"正在查询...",-1);
      
      var szm = $("#SanZiMa").text();
      $("#IISZM").text(szm.toLocaleUpperCase());
      appcan.locStorage.setVal("SZM",szm.toLocaleUpperCase()); 
      
      if(!szm){
          uexWindow.closeToast();
       alertts("提示","请输入三字码","确定");
       return;
      }else if($(startDate).text() == "请选择日期"){
          uexWindow.closeToast();
       alertts("提示","请选择开始时间","确定"); 
       return;  
      }else if($(endDate).text() == "请选择日期"){
          uexWindow.closeToast();
       alertts("提示","请选择结束时间","确定");  
       return; 
      }else{
          
          $.ajax({
              url:LCZJhttp+"zyh_queryTransfersI",
              type:"POST",
              dataType:"JSON",
              data:{
                tciCode:szm.toLocaleUpperCase(),
                startDate:$(startDate).text(),
                endDate:$(endDate).text()
                
              },
              success:function(res){
                res = JSON.parse(res);
                var data = JSON.parse(res.queryTransfersI);
                if(data.data && data.data.length > 0 && data.data != "[]"){
                    //console.log(data.data);
                  queryTransfersDCallBack(data.data);  
                }else{
                 uexWindow.toast(1,5,"暂时没有查询到数据...",3000);  
                }
                
                //console.log(JSON.parse(res.queryTransfersD));  
              },
              error:function(){
               uexWindow.toast(1,5,"网络异常...",3000);  
              }
          })
      }
      
  });
  
  function queryTransfersDCallBack(data){
       var tpl = "";
       data.forEach(function(item){
         
         var tplLeft = '<li>'
                     +'<div class="ub cwhite">'
                     +'<div class="bc8EC2DA w35 lh25 tx-c bdr-bw ub ub-ac ub-pc htit bs-lf">'
                     +'<div class="fs9">'+item.companyName+'</div>'
                     +'</div>'
                     +'<div class="ub-f1 c4892AA bcwhite tx-c">'
                     +'<div class="ub-ver">';
         var tplList = "";
         item.checkinList.forEach(function(item){
             
            //国内应办理人员总数
            var ntcDD = item.tcNumID+item.ntcNumID;
            var bfb = item.tcNumID/(item.tcNumID+item.ntcNumID)*100;
            bfb = bfb+'';
            if(item.tcNumID == 0 && item.ntcNumID == 0){
                bfb = '0';
            }
            //国内办理人员百分比
            bfb = bfb.substring(0,5)+'%';
            
            //国外应办理人员总数
            var ntcII = item.tcNumII+item.ntcNumII;
            var gwbfb = item.tcNumII/(item.tcNumII+item.ntcNumII)*100;
            gwbfb = gwbfb+'';
            if(item.tcNumII == 0 && item.ntcNumII == 0){
                gwbfb = '0';
            }
            //国外办理人员百分比
            gwbfb = gwbfb.substring(0,5)+'%';
            
            //归属地下属城市机场信息
           tplList += '<div style="overflow-x: hidden;" class="ub bdr-b3EC5F7 city_line" portName="'+item.portName+'" tcNumDD="'+item.tcNumID+'" ntcDD="'+ntcDD+'" bfb="'+bfb+'" portCode3="'+item.portCode3+'" tcNumII="'+item.tcNumII+'" ntcNumII="'+item.ntcNumII+'">'
                   +'<div class="w30 h25 lh25 ">'
                   +'<div class="fs10 wtp100 hide">'+item.portName+'</div>'
                   +'</div><div class="ub-f1">'
                   +'<div class="ub">'
                   +'<div class="pl5 h25 lh25 wtp33 tx-c">'
                   +'<div class="fs11">'+item.tcNumII+'</div>'
                   +'</div>'
                   +'<div class="pl9 h25 lh25 wtp33 tx-c">'
                   +'<div class="fs11">'+ntcII+'</div>'
                   +'</div>'
                   +'<div class=" h25 lh25 wtp25 tx-c">'
                   +'<div class="fs11">'+gwbfb+'</div>'
                   +'</div>'
                   +'<div class="btn-img h25 lh25 tx-c w15"></div>'
                   +'</div>'
                   +'</div>'
                   +'</div>';
           
         });
         
         tpl += tplLeft+tplList+'</div></div></div></li>';  
         //加载列表数据  
         $("#list_ul").html(tpl);
         //关闭提示
         uexWindow.closeToast();
      });
      //点击进去详情页
     $(".city_line").click(function(){
       var location = $(this).parent().parent().prev().find('div')[0];
       //保存中转值机信息
       var inand = {};
       //归属地
       inand.location = $(location).text();
       //城市
       inand.portName = $(this).attr('portName');
       //三字码
       inand.portCode3 = $(this).attr('portCode3');
       //国内办理总人数
       inand.tcNumDD = $(this).attr('tcNumDD');
       //国内应办理总人数
       inand.ntcDD = $(this).attr('ntcDD');
       //国内办理百分比
       inand.gnbfb = $(this).attr('bfb');
       //国际办理总人数
       inand.tcNumDI = $(this).attr('tcNumII');
       //国际应办理总人数
       inand.ntcNumDI = Number($(this).attr('tcNumII')) + Number($(this).attr('ntcNumII'));
       //国际办理百分比
       inand.gjbfb = Number($(this).attr('tcNumII'))/inand.ntcNumDI*100;
       inand.gjbfb = inand.gjbfb+'';
       if($(this).attr('tcNumDI') == '0' && $(this).attr('ntcNumDI')){
       inand.gjbfb = "0";    
       }
       inand.gjbfb = inand.gjbfb.substring(0,5)+"%";
       //国际+国内办理统计总人数
       inand.gngjNumDDDI = Number(inand.tcNumDD) + Number(inand.tcNumDI);
       //国际+国内应办理统计总人数
       inand.ngngjNumDDDI = Number(inand.ntcDD) +　Number(inand.ntcNumDI);
       //国际国内办理统计百分比
       inand.gngjbfb = inand.gngjNumDDDI/inand.ngngjNumDDDI * 100;
       inand.gngjbfb = inand.gngjbfb+'';
       if(inand.gngjNumDDDI == 0 && inand.gngjNumDDDI == 0){
        inand.gngjbfb = '0';   
       }
       inand.gngjbfb = inand.gngjbfb.substring(0,5)+"%";

       //console.log(JSON.stringify(inand));  
       //保存国内国际办理中转值机信息汇总。
       appcan.locStorage.setVal('inand',JSON.stringify(inand));
 
        appcan.window.open({
         name: "connectingDetail",
         dataType: 0,
         aniId: 5,
         data: "connectingDetail.html",   
        })
     });
  }
  
  function setSanZiMa(){
      var evaluate = {};
      evaluate.windowName = "connectingFlight";
      evaluate.popName = "content";
      evaluate.pageName = "foreign";
      evaluate.type = 0;
      appcan.locStorage.setVal("evaluateObj",JSON.stringify(evaluate));
      appcan.window.open('LCairport_select1', 'LCairport_select1.html', '2', '4', 0, 0, 200);
  }
  
  function setAirPort(code){
      
      $("#SanZiMa").text(code);
  }
  
  
  //提示框
  function alertts(t, c, b) {
             
            appcan.window.alert({
                title : t,
                content : c,
                buttons : b
            });
        }
  
     
   </script>
</html>
